package client.networking;

/**
 * The ClientCallback class serves as the implementation of the
 * ClientCallbackInterface. The remote server has access to the
 * methods specified in this class.
 */

import java.rmi.RemoteException;
import controller.GameController;

public class ClientCallback implements ClientCallbackInterface {
	/**
	 * Field giving access to the methods in the GameController.
	 */
	private GameController gameController;
	
	/**
	 * Constructor method.
	 * @param gameController The GameController object.
	 */
	public ClientCallback(GameController gameController) {
		this.gameController = gameController;
	}
	
	/**
	 * Testing method used to send a string from the server to the client.
	 * @param string The string to send to the client.
	 */
	
	@Override
	public void printTextString(String string) throws RemoteException {
		System.out.println(string);
	}
	
	/**
	 * Refreshes the table with the tableID specified by the parameter.
	 * @param tableID A unique integer representing the table on the server.
	 */
	public void refreshTable(int tableID) throws RemoteException {
		gameController.refreshTable(tableID);
	}
	
}